Skip to content

fix(arrow/scalar): allow null extension scalars to keep null storage - #1000

Merged
zeroshade merged 3 commits into
apache:mainfrom
fallintoplace:fix/scalar-null-extension-validation
Jul 27, 2026
Merged

fix(arrow/scalar): allow null extension scalars to keep null storage#1000
zeroshade merged 3 commits into
apache:mainfrom
fallintoplace:fix/scalar-null-extension-validation

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

MakeNullScalar represents a null extension scalar with a null storage scalar. Extension.Validate rejected that factory-created shape even though it is the natural null representation.

This allows validated null storage for null extension scalars, still rejects non-null storage, and adds regression coverage for both cases.

Tests: go test ./arrow/scalar

@fallintoplace
fallintoplace requested a review from zeroshade as a code owner July 24, 2026 23:32
@fallintoplace fallintoplace changed the title fix(arrow/scalar): validate null extension scalars fix(arrow/scalar): accept null storage in null extension scalars Jul 25, 2026
@fallintoplace fallintoplace changed the title fix(arrow/scalar): accept null storage in null extension scalars fix(arrow/scalar): allow null storage in null extension scalars Jul 25, 2026
@fallintoplace fallintoplace changed the title fix(arrow/scalar): allow null storage in null extension scalars fix(arrow/scalar): allow null extension scalars to keep null storage Jul 25, 2026

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: `MakeNullScalar` on an extension type produces `Valid=false` with a non-nil (but null) storage scalar, and the old `Extension.Validate` rejected any non-nil storage when invalid — so the factory produced a scalar that failed its own validation. I reproduced the "null extension_type<storage=int16> scalar has storage value" error on `main`. The fix correctly permits null storage while still rejecting non-null storage. LGTM.

@zeroshade
zeroshade merged commit 825b3f3 into apache:main Jul 27, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants